<%@page import="test0.dao.factory.DAOfactory"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="test0.dao.vo.Emp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%request. setCharacterEncoding("UTF-8"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>完成DAO操作增加雇员</title>
</head>
<body>
<%
	Emp emp=new Emp();
	emp.setEmpno(Integer.parseInt(request.getParameter("empno")));
	emp.setEname(request.getParameter("ename"));
	emp.setJob(request.getParameter("job"));
	emp.setHiredate(new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("hiredate")));
	emp.setSal(Float.parseFloat(request.getParameter("sal")));
	try{
		if(DAOfactory.getIEmpDAOInstance().doCreate(emp)){
			%>
			<h1>雇员信息添加成功</h1>
			<%
		}else{
			%>
			<h1>雇员信息添加失败</h1>
			<%
		}
		
	}catch(Exception e){
		e.printStackTrace();
	}
	
	
%>
</body>
</html>